package com.xxx.service;

import com.xxx.pojo.Account;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/16 9:27
 * @Copyright 博为峰
 */
public class CreditAccount extends Account implements IRepay {
    private double ceiling;

    public CreditAccount() {
    }

    public CreditAccount(String cardNo, String password, double balance) {
        super(cardNo, password, balance);
    }

    public CreditAccount(String cardNo, String password, double balance, double ceiling) {
        super(cardNo, password, balance);
        this.ceiling = ceiling;
    }

    @Override
    public void deposit(double money){
        double balance = this.getBalance() + ceiling;
        balance -= money;
        this.setBalance(balance);
    }

    @Override
    public void loan() {

    }
}
